﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;

namespace FCMS.Mvc
{
    public class SkinManager
    {
        public static void LoadViewEngine<T>(T currentViewEngine) where T : RazorViewEngine
        {
            IViewEngine viewengine = ViewEngines.Engines.FirstOrDefault(v => v.GetType().Name == typeof(T).Name);
            if (viewengine == null)
            {
                ViewEngines.Engines.Add(currentViewEngine);
            }
            else
            {
                ViewEngines.Engines.Remove(viewengine);
                ViewEngines.Engines.Add(currentViewEngine);
            }
        }
    }
}
